/*    */ package com.zimbra.cs.service.mail;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.Element;
/*    */ import com.zimbra.common.soap.MailConstants;
/*    */ import com.zimbra.cs.index.SortBy;
/*    */ import com.zimbra.cs.mailbox.MailItem;
/*    */ import com.zimbra.cs.mailbox.MailItem.Type;
/*    */ import com.zimbra.cs.mailbox.Mailbox;
/*    */ import com.zimbra.cs.mailbox.OperationContext;
/*    */ import com.zimbra.cs.mailbox.SearchFolder;
/*    */ import com.zimbra.cs.service.util.ItemIdFormatter;
/*    */ import com.zimbra.soap.ZimbraSoapContext;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class GetSearchFolder
/*    */   extends MailDocumentHandler
/*    */ {
/*    */   public Element handle(Element request, Map<String, Object> context)
/*    */     throws ServiceException
/*    */   {
/* 40 */     ZimbraSoapContext zsc = getZimbraSoapContext(context);
/* 41 */     Mailbox mbox = getRequestedMailbox(zsc);
/* 42 */     OperationContext octxt = getOperationContext(zsc, context);
/* 43 */     ItemIdFormatter ifmt = new ItemIdFormatter(zsc);
/*    */     
/* 45 */     Element response = zsc.createElement(MailConstants.GET_SEARCH_FOLDER_RESPONSE);
/*    */     
/* 47 */     List<? extends MailItem> results = mbox.getItemList(octxt, MailItem.Type.SEARCHFOLDER, -1, SortBy.NONE);
/*    */     
/* 49 */     if (results != null) {
/* 50 */       for (MailItem item : results) {
/* 51 */         ToXML.encodeSearchFolder(response, ifmt, (SearchFolder)item);
/*    */       }
/*    */     }
/* 54 */     return response;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/service/mail/GetSearchFolder.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */